import { ToolTipItem } from "../../../../com/mui/manager/ToolTipItem";
import { LoaderHelp } from "../../../common/display/LoaderHelp";
import { ResFileConst } from "../../resource/ResFileConst";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../resource/ImagesConst";
import { Cache } from "../../cache/Cache";
import { DiceExpConfig } from "../../resource/DiceExpConfig";
import { Language } from "../../../../extend/language/Language";
type int = number;
//class FuTip
    
    export  class FuTip extends ToolTipItem
    {
        constructor()
        {
            super();
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            this._bitmap = new Object /* flash.display.Bitmap */();
            this._sp = new Object /* flash.display.Sprite */();
            this.addChild(this._sp);
            this._sp.addChild(this._bitmap);
            this.toolTipData = this.getTipData();
            LoaderHelp.addResCallBack(ResFileConst.playDice, this.onPlayDiceOK);
            this._sp.addEventListener(flash.events.MouseEvent.MOUSE_OVER, this.onMouseOver);
            this._sp.addEventListener(flash.events.MouseEvent.MOUSE_OUT, this.onMouseOut);
            return;
        }

        protected onMouseOut(arg1: Object /* flash.events.Event */): void
        {
            this._bitmap.bitmapData = GlobalClass.getBitmapData(ImagesConst.DiceFuTip);
            return;
        }

        protected onMouseOver(arg1: Object /* flash.events.Event */): void
        {
            this._bitmap.bitmapData = GlobalClass.getBitmapData(ImagesConst.DiceFuTipSharp);
            return;
        }

        /* internal  */onPlayDiceOK(): void
        {
            this._bitmap.bitmapData = GlobalClass.getBitmapData(ImagesConst.DiceFuTip);
            return;
        }

        /* internal  */getTipData(): string
        {
            var loc2=null;
            var loc3=0;
            var loc4=0;
            var loc5=0;
            var loc1=Cache.instance.role.entityInfo.level;
            if (loc1 < 60) 
            {
                return "";
            }
            if (!this._tipData) 
            {
                this._tipData = "";
                loc2 = [3, 5, 7, 10];
                loc5 = 0;
                while (loc5 < loc2.length) 
                {
                    loc3 = loc2[loc5] as int;
                    loc4 = DiceExpConfig.instance.getFullDiceExp(loc1 + "_" + loc3);
                    this._tipData = this._tipData + Language.getStringByParam(70304, loc3, loc4);
                    if (loc5 != (loc2.length - 1)) 
                    {
                        this._tipData = this._tipData + "\n\n";
                    }
                    this._tipData = "<textFormat leading=\'5\'><font color=\'#ffffff\'>" + this._tipData + "</font></textFormat>";
                    ++loc5;
                }
            }
            return this._tipData;
        }

        /* internal */ /* var */_bitmap: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_tipData: string;

        /* internal */ /* var */_sp: Object /* flash.display.Sprite */;
    }
